﻿using Mysoft.Platform.Component.Attributes;

namespace Mysoft.Platform.Component.Caches
{
	public class CacheManager
	{
		private static readonly object LockSync = new object();
		private static volatile ICachable _default = null;

		public static ICachable Default
		{
			get
			{
				if (_default == null)
				{
					lock (LockSync)
					{
						if (_default == null)
						{
							_default = new DotnetCache();
						}
					}
				}
				return _default;
			}
		}

		public static string GetMenuKey(UserGroup group)
		{
			return "Menu_" + group.ToString();
		}
	}
}